#include <stdio.h>
#include <stdlib.h>

#define NormalCode 0
#define ErrorCode 1

typedef struct StringNode *Position; /* 指针即结点位置 */
struct StringNode {
    char data; /* 存储数据 */
    Position next; /* 链接存储中下一个元素的位置 */
};
typedef struct StringHeadNode *String;
struct StringHeadNode {
    Position head; /* 字符串头指针，初始化为NULL */
    int length; /* 字符串长度 */
};

String InitStr() {
    /* 初始化一个空的字符串 */
    String s;

    s = (String)malloc(sizeof(struct StringHeadNode));
    s->head = NULL;
    s->length = 0;

    return s;
}

/* 算法4-10：字符串比较操作  StrCompare(s,t) */
int StrCompare(String s, String t) {
    Position sp, tp;
    int ret;

    sp = s->head;
    tp = t->head;
    while ((sp != NULL) && (tp != NULL) && (sp->data == tp->data)) {
        /* 顺次比较s和t等长的部分 */
        sp = sp->next;
        tp = tp->next;
    }
    if ((sp != NULL) && (tp == NULL)) {
        ret = 1;
    } else if ((sp == NULL) && (tp != NULL)) {
        ret = -1;
    } else if ((sp == NULL) && (tp == NULL)) {
        ret = 0;
    } else if (sp->data > tp->data) {
        ret = 1;
    } else {
        ret = -1;
    }
    return ret;
}
/* 算法4-10 结束 */

String ReadString() {
    String s;
    Position tail;
    char c;

    s = InitStr(); /* 创建空的字符串 */
    s->head = (Position)malloc(sizeof(struct StringNode));
    tail = s->head; /* 先创建临时空头结点 */
    c = getchar();
    while (c != '\n') {
        tail->next = (Position)malloc(sizeof(struct StringNode));
        tail->next->data = c;
        tail = tail->next;
        s->length++;
        c = getchar();
    }
    tail->next = NULL; /* 链表收尾 */
    tail = s->head;
    s->head = s->head->next;
    free(tail); /* 删除临时空头结点 */
    return s;
}

int main(void) {
    String s, t;

    s = ReadString();
    t = ReadString();
    printf("%d\n", StrCompare(s, t));

    return 0;
}